from webevent.models import WebEnvents
import webevent.events as events
import json

def writeEvent(data, user, event, ext_pk=0):
  event = WebEnvents()
  event.data = json.dumps(data)
  event.user = user
  event.ext_pk = ext_pk
  event.event = event
  event.save()

def writeLogin(user):
  writeEvent({}, user, events.loginEvent)

